package com.xbongbong.saas.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.enums.PaymentSheetTypeEnum;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.FieldAttrEntityForImport;
import com.xbongbong.paas.pojo.dto.AggSumDTO;
import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.FormDataSummaryDTO;
import com.xbongbong.paas.pojo.dto.ImportFormDataDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.pojo.imports.CellTitlePojo;
import com.xbongbong.paas.pojo.imports.RowGroupPojo;
import com.xbongbong.paas.pojo.vo.AggSumVO;
import com.xbongbong.paas.pojo.vo.FormDataRepeatVO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.applist.pojo.vo.ListAppVO;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.businessproduct.pojo.dto.BusinessProductListDTO;
import com.xbongbong.pro.common.pojo.dto.RepeatCommonConditionDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractDeleteBatchDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractEditAttrUpdateDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractRestoreOutboundDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractUpdateBatchDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractUpdateCashProfitDTO;
import com.xbongbong.pro.contract.pojo.dto.ContractUpdateWhenOutstockDTO;
import com.xbongbong.pro.contract.pojo.vo.ContractDeleteBatchVO;
import com.xbongbong.pro.contract.pojo.vo.ContractEditAttrUpdateVO;
import com.xbongbong.pro.contract.pojo.vo.ContractUpdateBatchVO;
import com.xbongbong.pro.customer.pojo.dto.ChangeStatusDTO;
import com.xbongbong.pro.detailtab.dto.ChangeDocumentStatusSaveDTO;
import com.xbongbong.pro.detailtab.vo.ChangeDocumentStatusSaveVO;
import com.xbongbong.pro.detailtab.vo.ProductSummaryVO;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.pro.formdata.pojo.AfterSavePojo;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.pro.formexplain.pojo.dto.HandlerExplainInLinkItemDTO;
import com.xbongbong.pro.listbatch.pojo.dto.AddLabelDTO;
import com.xbongbong.pro.product.pojo.ProductSavePojo;
import com.xbongbong.pro.product.pojo.dto.PagingProductDTO;
import com.xbongbong.pro.product.pojo.vo.PagingProductVO;
import com.xbongbong.pro.sheet.pojo.dto.SheetDeleteHandleRelateDTO;
import com.xbongbong.saas.domain.entity.ContractProductEntity;
import com.xbongbong.saas.domain.entity.ext.ContractEntityExt;
import com.xbongbong.saas.domain.entity.ext.OutstockProductEntityExt;
import com.xbongbong.saas.enums.UpdateDataTypeEnum;
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 合同业务处理接口
 *
 * @author feng.zheng
 * @version v1.0
 * @date 2019/1/18
 * @since v1.0
 */
public interface ContractService {
    /**
     * 合同保存前saas特殊校验
     *
     * @param validateDataDTO saas特殊校验数据入参
     * @throws XbbException 业务异常
     * @author feng.zheng
     * @date 2019/1/20
     */
    void beforeSave(ValidateDataDTO validateDataDTO) throws XbbException;

    /**
     * 合同保存后逻辑
     *
     * @param saasFormSaveDTO saas保存数据
     * @throws XbbException 业务异常
     * @author feng.zheng
     */
    AfterSavePojo afterSave(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    /**
     * 新建时格式化解释
     *
     * @param formatExplainDTO 入参
     * @throws XbbException 异常
     * @author long.rao
     * @date 2019-02-22 14:55
     */
    void formatAddExplain(FormatExplainDTO formatExplainDTO) throws XbbException;

    /**
     * 关联新建时格式化解释
     *
     * @param handlerExplainInLinkItemDTO 入参
     * @throws XbbException 异常
     * @author long.rao
     * @date 2019-02-22 14:55
     */
    void formatLinkAddExplain(HandlerExplainInLinkItemDTO handlerExplainInLinkItemDTO) throws XbbException;


    /**
     * 合同名称实时查重
     *
     * @param repeatCommonConditionDTO 查重共用条件
     * @param contractName             合同名称
     * @return com.xbongbong.paas.pojo.vo.FormDataRepeatVO
     * @author feng.zheng
     * @throws XbbException 业务异常
     * @date 2019/2/20 13:47
     */
    FormDataRepeatVO checkRepeatForContractName(RepeatCommonConditionDTO repeatCommonConditionDTO, String contractName) throws XbbException;

    /**
     * 获取红冲合同剩余未入库产品信息及数量
     * @param corpid 公司Id
     * @param contractId 合同id
     * @param contractEntityExt 此参数可以为null ，用于更新关联入库单id，更安全
     * @param instockIdList  此参数用来去除特定入库单，显示红冲合同剩余入库产品，用于编辑入库单使用，可以为null
     * @throws XbbException 异常
     * @return List<ContractProductEntity>
     * @date 2019/2/25 10:09
     */
    List<ContractProductEntity> getRedSurplusProduct(String corpid, Long contractId, ContractEntityExt contractEntityExt, List<Long> instockIdList) throws XbbException;


    /**
     * 获取红冲合同产品，并且计算入库成本
     *
     * @param corpid 公司id
     * @param contractId 红冲合同id
     * @return 红冲合同关联的出库产品
     * 修改时间：2018-04-26 15:54
     * @author lcx
     * @since 1.0
     */
    List<ContractProductEntity> getRedContractOutstockProducts(String corpid, Long contractId) throws XbbException;

    /**
     * 获取合同剩余未出库产品信息及数量
     * @Param corpid 公司id
     * @param contractId 合同id
     * @param contractEntity 此参数可以为null ，用于更新关联出库单id，更安全
     * @param outstockIdList  此参数用来去除特定出库单，显示合同剩余出库产品，用于编辑出库单使用，可以为null
     * @return
     */
    List<ContractProductEntity> getSurplusProduct(String corpid, Long contractId, ContractEntityExt contractEntity,
                                                         List<Long> outstockIdList) throws XbbException;

    /**
     * 格式化产品，显示给前端
     * @param dataList 实体数据
     * @param saasAnalysisDataDTO 数据解析DTO
     * @throws XbbException
     * @author long.rao
     * @date 2019-03-02 16:35
     */
    void formatProduct4Show(JSONObject dataList, SaasAnalysisDataDTO saasAnalysisDataDTO) throws XbbException;


    /**
     * 批量更新
     * @author 吴峰
     * @date 2019/3/5 14:14
     * @param contractUpdateBatchDTO
     * @return com.xbongbong.pro.contract.pojo.vo.ContractUpdateBatchVO
     * @throws XbbException 业务异常
     */
    ContractUpdateBatchVO updateBatch(ContractUpdateBatchDTO contractUpdateBatchDTO) throws XbbException;

    /**
     * 批量更新
     * @author 吴峰
     * @date 2019/3/5 14:14
     * @param contractUpdateBatchDTO
     * @return com.xbongbong.pro.contract.pojo.vo.ContractUpdateBatchVO
     * @throws XbbException 业务异常
     */
    ContractUpdateBatchVO updateBatchImmediately(ContractUpdateBatchDTO contractUpdateBatchDTO) throws XbbException;


    /**
     * 批量更新--同时更新更新时间
     * @param contractUpdateBatchDTO
     * @param isUpdateTime 是否更新更新时间 true更新，false不更新
     * @return
     * @throws XbbException
     */
    ContractUpdateBatchVO updateBatch(ContractUpdateBatchDTO contractUpdateBatchDTO, Boolean isUpdateTime) throws XbbException;

    /**
     * 禁止调用
     * @param contractUpdateBatchDTO
     * @param isUpdateTime
     * @param needThrow
     * @return
     * @throws XbbException
     */
    @Deprecated
    ContractUpdateBatchVO updateBatch(ContractUpdateBatchDTO contractUpdateBatchDTO, Boolean isUpdateTime,boolean needThrow) throws XbbException;

    /**
     * 批量删除合同
     * @author 吴峰
     * @date 2019/3/13 14:02
     * @param contractDeleteBatchDTO
     * @return com.xbongbong.pro.contract.pojo.vo.ContractDeleteBatchVO
     * @throws XbbException 业务异常
     */
    ContractDeleteBatchVO deleteBatch(ContractDeleteBatchDTO contractDeleteBatchDTO) throws XbbException;

    /**
     * 根据应收款ID回滚回款单
     * @param paymentIdIn
     * @param corpid
     * @throws XbbException
     */
    void updateRollbackPaymentSheetByPayment(List<Long> paymentIdIn, String corpid) throws XbbException;

    /**
     * 格式化移动端列表页
     *
     * @param formDataListDTO 用户
     * @param esEntities 业务实体集合
     * @param totalCount 总数
     * @return ListAppVO
     * @throws XbbException
     * @author long.rao
     * @date 2019-03-11 13:50
     */
    ListAppVO formatContractAppList(FormDataListDTO formDataListDTO, List<PaasFormDataEntityExt> esEntities, Integer totalCount) throws XbbException;

    /**
     * 批量编辑单个字段
     * @author 吴峰
     * @date 2019/3/18 15:57
     * @param contractEditAttrUpdateDTO
     * @return com.xbongbong.pro.contract.pojo.vo.ContractEditAttrUpdateVO
     * @throws XbbException 业务异常
     */
    ContractEditAttrUpdateVO batchEditAttr(ContractEditAttrUpdateDTO contractEditAttrUpdateDTO) throws XbbException;

    /**
     * 计算合同毛利率等相关数据
     * @param numCountList
     * @param formDataSummaryDTO
     * @param aggAvgFieldList
     * @return
     * @throws XbbException
     */
    List<AggSumVO> avgBySumList(List<AggSumVO> numCountList, FormDataSummaryDTO formDataSummaryDTO, List<AggSumDTO> aggAvgFieldList, NativeSearchQuery searchQuery) throws XbbException;

    /**
     * 销售出库时更新合同成本
     * @author 吴峰
     * @date 2019/4/5 14:06
     * @param contractUpdateWhenOutstockDTO
     * @return void
     * @throws XbbException 业务异常
     */
    void updateContractCostWhenOutstock(ContractUpdateWhenOutstockDTO contractUpdateWhenOutstockDTO, ContractEntityExt contractEntityExt) throws XbbException;

    /**
     * 获取合同关联的产品
     * @param businessProductListDTO
     * @param dataList
     * @return
     * @throws XbbException
     */
//    BusinessProductListVO getContractProductList(BusinessProductListDTO businessProductListDTO, JSONObject dataList) throws XbbException;

    /**
     * 通过客户id获取合同
     *
     * @param  corpid       公司id
     * @param  customerId   客户id
     * @author GuoJun.HU
     * @since V1.0
     * @return List
     * @date 2019/4/11 11:35
     */
    List<PaasFormDataEntityExt> getContractEsDataListByCustomerId(String corpid, Long customerId) throws XbbException;

    /**
     * 销售出库产品增加售价和折扣列：解释explains
     *
     * @param productJSONObject 数据
     * @param outstockProduct
     * @param product
     * @param amountPrecision
     * @param showSalePriceFlag
     * @author 吴峰
     * @date 2019/4/8 14:48
     **/
    void addSalePriceAndDiscountExplains(JSONObject productJSONObject, OutstockProductEntityExt outstockProduct, PaasFormDataEntityExt product,
                                         Integer amountPrecision, Integer showSalePriceFlag);

    /**
     * 更改合同状态
     *
     * @param changeStatusDTO
     * @throws
     * @author long.rao
     * @date 2019-04-15 20:41
     */
    BaseVO changeStatus(ChangeStatusDTO changeStatusDTO) throws XbbException;

    /**
     * 获取某个合同关联的产品
     * @param corpid
     * @param contractId
     * @return
     * @throws XbbException
     */
    List<ContractProductEntity> getContractProductList(String corpid, Long contractId) throws XbbException;

    /**
     * 将Excel数据格式化成表单保存需要的JSON格式的数据
     *
     * @param importFormDataDTO 导入入参
     * @param titlePojoList     标题
     * @param rowGroupPojo      一个表单对应的一组Excel填写的数据
     * @param fieldAttrList     解释
     * @return FormDataAddDTO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/4/29 14:16
     * @since V1.0
     */
    FormDataAddDTO formatExcelValue(ImportFormDataDTO importFormDataDTO, List<CellTitlePojo> titlePojoList, RowGroupPojo rowGroupPojo, List<FieldAttrEntityForImport> fieldAttrList) throws XbbException;

    /**
     * 更新现金毛利
     * @param updateCashProfitDTO
     * @throws XbbException
     */
    void updateCashProfit(ContractUpdateCashProfitDTO updateCashProfitDTO) throws XbbException;


    void updateCashProfit(String corpid, Double sheetAmount, Long contractId, PaasFormDataEntity linkContractEntity, Integer distributorMark) throws XbbException;

    /**
     * 批量更新现金毛利
     * @param corpid 公司ID
     * @param sheetAmount 回款单金额
     * @param contractIds 合同ID集合
     * @throws XbbException error
     * @author zhouwq
     * @date 2019/11/18 9:41
     */
    void updateBatchCashProfit(String corpid, Double sheetAmount, Collection<Long> contractIds) throws XbbException;

    /**
     * 格式化导出值
     *
     * @param paasFormDataESList 数据
     * @throws XbbException 异常
     */
    void formatExportValue(List<PaasFormDataEntityExt> paasFormDataESList, FormDataListDTO formDataListDTO, List<FieldAttrEntityForImport> fieldAttrList, Integer businessType) throws XbbException;

    /**
     *  删除出库单后更改出库状态和合同状态
     * @param contractRestoreOutboundDTO
     * @throws XbbException
     */
    void restoreNewContractOutboundAndStatus(ContractRestoreOutboundDTO contractRestoreOutboundDTO) throws XbbException;
    /**
     * 获取移动端待采购(待生产)中的合同
     *
     * @param formDataListDTO 列表查询DTO
     * @param paasFormDataEsListVO 列表查询回参
     * @throws XbbException
     * @author long.rao
     * @date 2019-05-31 11:03
     */
    ListAppVO formatWaitContract(FormDataListDTO formDataListDTO, PaasFormDataEsListVO paasFormDataEsListVO) throws XbbException;

    /**
     * @Author: wujian
     * @Description: 获取移动端待采购合同视图数据
     * @Date: 下午7:08 2022/2/16
     * @Param: [formDataListDTO, paasFormDataEsListVO]
     * @return: com.xbongbong.pro.applist.pojo.vo.ListAppVO
     **/
    ListAppVO formatWaitPurchaseContract(FormDataListDTO formDataListDTO, PaasFormDataEsListVO paasFormDataEsListVO) throws XbbException;

    /**
     * 获取移动端待入库中的合同维度信息
     *
     * @param formDataListDTO 列表查询DTO
     * @param paasFormDataEsListVO 列表查询回参
     * @throws XbbException
     * @author youli.chen
     * @date 2019-05-31 11:03
     */
    ListAppVO formatWaitPurchaseInstock(FormDataListDTO formDataListDTO, PaasFormDataEsListVO paasFormDataEsListVO) throws XbbException;

    /**
     * 获取移动端待入库中的产品维度信息
     *
     * @param formDataListDTO 列表查询DTO
     * @param paasFormDataEsListVO 列表查询回参
     * @throws XbbException
     * @author jiping.yang
     * @date 2021-09-23 11:03
     */
    ListAppVO formatWaitProductInstock(FormDataListDTO formDataListDTO, PaasFormDataEsListVO paasFormDataEsListVO) throws XbbException;

    /**
     * 获取移动端待出库中的合同
     *
     * @param formDataListDTO 列表查询DTO
     * @param formDataListVO  列表查询回参
     * @throws XbbException
     * @author youli.chen
     * @date 2019-05-31 11:03
     */
    ListAppVO formatWaitContractOutstock(FormDataListDTO formDataListDTO, PaasFormDataEsListVO formDataListVO) throws XbbException;
    /**
     * Description: 一致性同步客户
     * @param corpid
     * @param customerId
     * @param customerName
     * @author 魏荣杰
     * @date 2019/6/12 9:27
     * @since v1.0
     */
    void dataConsistencyUpdateCustomer(String corpid, Long customerId, String customerName) throws XbbException;
    /**
     * Description: 一致性同步合作客户名称
     * @param corpid
     * @param customerId
     * @param customerName
     * @author 魏荣杰
     * @date 2019/6/12 9:27
     * @since v1.0
     */
    void dataConsistencyUpdatePartner(String corpid, Long customerId, String customerName) throws XbbException;
    /**
     * Description: 一致性更新联系人
     * @param corpid
     * @param contactId
     * @param contactName
     * @author 魏荣杰
     * @date 2019/6/12 9:27
     * @since v1.0
     */
    void dataConsistencyUpdateContact(String corpid, Long contactId, String contactName) throws XbbException;

    /**
     * Description: 一致性更新报价单
     * @param corpid
     * @param quotationId
     * @param quotationName
     * @throws XbbException
     * @author long.rao
     * @date 2019-09-10 15:16
     */
    void dataConsistencyUpdateQuotation(String corpid, Long quotationId, String quotationName) throws XbbException;

    /**
     * 出库单保存后判断是否出库完毕
     * @param outstockId
     * @param refId
     * @param corpid
     * @param productSavePojoList
     * @return
     */
    boolean judgeContractAllOutBound(Long outstockId, Long refId, String corpid, List<ProductSavePojo> productSavePojoList) throws XbbException;

    /**
     * 更新回滚es
     * @param idIn
     * @param corpid
     * @throws XbbException
     */
    void updateRollback(Collection<Long> idIn, String corpid) throws XbbException;

    /**
     * 更新回滚es
     * @param contracts es要回滚为的数据list
     * @param corpid
     * @throws XbbException
     */
    void updateRollback(List<ContractEntityExt> contracts, String corpid) throws XbbException;

    Double getCost(PaasFormDataEntityExt entityExt) throws XbbException;

    /**
     * 汇总合同产品信息（详情页，几种产品几件）
     *
     * @param businessProductListDTO 入参
     * @throws XbbException
     * @author long.rao
     * @date 2019-08-28 10:23
     */
    ProductSummaryVO summaryProductList(BusinessProductListDTO businessProductListDTO) throws XbbException;

    /**
     * 创建回款单时，处理合同并封装要更新的结果：判断已收金额是否已经超过合同内的未收金额，并把合同的已收金额增加、合同毛利重新计算等
     * 已核销、预收款核销：已收金额增加，未收减少，限制回款金额小于合同的未收
     * 毛利的更新，根据ContractServiceImpl.updateBatchCashProfit 方法内计算处理
     *
     * @param distributorMark 经销商标识
     * @param paymentSheetTypeEnum 回款类型
     * @param corpid 公司id
     * @param contractIdToAmount 合同id-该合同对应的回款金额
     * @param contractIds 合同ids
     * @return java.util.List<com.xbongbong.pro.domain.entity.UpdateDataEntity>
     * @throws XbbException
     * @author zcp
     * @date 19/11/23 023 21:02
     * @update 19/11/23 023 21:02
     * @since v1.0
     * @version v1.0
     */
    List<UpdateDataEntity> handleContract(Integer distributorMark, PaymentSheetTypeEnum paymentSheetTypeEnum, String corpid, Map<Long, Double> contractIdToAmount, Set<Long> contractIds) throws XbbException;

    /**
     * 删除回款单时，同步更新合同
     * @param corpid 公司id
     * @param errorTypeSet 不允许删除类型
     * @param errorDataSet 不允许删除数据
     * @param allDelIdList 所有要删除的回款单id集合（因为重置更新应收款的时间时，需要查询除allDelIdList之外的回款单）
     * @param sheetDeleteHandleRelateDTO 删除/批量删除回款单，更新其关联业务（客户、合同、应收款）dto
     * @return java.util.List<com.xbongbong.pro.domain.entity.UpdateDataEntity>
     * @throws XbbException
     * @author zcp
     * @date 19/12/6 006 23:02
     * @update 19/12/6 006 23:02
     * @since v1.0
     * @version v1.0
     */
    List<UpdateDataEntity> updateContract4Del(String corpid, Set<String> errorTypeSet, Set<String> errorDataSet, Collection<Long> allDelIdList, SheetDeleteHandleRelateDTO sheetDeleteHandleRelateDTO) throws XbbException;

    /**
     * 根据合同id编号获取合同数据
     * @param corpid
     * @param contractIds
     * @return
     * @throws XbbException
     */
    List<ContractEntityExt> getContractListByIds(String corpid, List<Long> contractIds) throws XbbException;

    void formatProduct4Show3(List<ContractProductEntity> contractProductEntityList, JSONObject productData, UpdateDataTypeEnum linkAdd) throws XbbException;

    PagingProductVO getPagingProduct(PagingProductDTO pagingProductDTO) throws XbbException;

    JSONObject formatSingleProduct(ContractProductEntity entity);

    JSONObject formatSingleRefundProduct(ContractProductEntity entity);


    /**
     * Description: 获取合同名称集合
     * @param handoverIdSet
     * @param corpid
     * @author 刘阳
     * @date 2020/1/8 2:41 PM
     * @since v1.0
     */
    Map<Long, String> getContractNameMap(List<Long> handoverIdSet, String corpid) throws XbbException;
    /**
     * Description: 获取合同编号集合
     * @param contractIdIn
     * @param corpid
     */
    Map<Long, String> getContractNoMap(List<Long> contractIdIn, String corpid) throws XbbException;
    /**
     * 跟新合同开启关闭状态
     * @param changeDocumentStatusSaveDTO
     * @return
     */
    ChangeDocumentStatusSaveVO changeDocumentStatus(ChangeDocumentStatusSaveDTO changeDocumentStatusSaveDTO) throws XbbException;

    /**
     * 标签新增或者删除标签
     * @param addLabelDTO
     * @param addBatchList
     * @throws XbbException
     */
    void updateBatchLabelAttr(AddLabelDTO addLabelDTO, List<PaasFormDataEntityExt> addBatchList, Boolean addOrDelete) throws XbbException;

    /**
     * Description: 合同保存后操作（工作流使用）
     * @param saasFormSaveDTO
     * @return void
     * @throws
     * @author 魏荣杰
     * @date 2021/6/21 09:30
     * @since
     */
    void afterSaveForWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;

    void afterSaveForUpdateWorkflow(SaasFormSaveDTO saasFormSaveDTO) throws XbbException;
    /**
     * 获取移动端待出库列表----产品维度
     *
     * @param formDataListDTO      列表页请求参数
     * @throws XbbException
     * @author ruansicheng
     * @date 2021/9/23 10点52分
     */
    ListAppVO formatWaitPrductOutstock(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * 以销订购合同维度导出
     *
     * @param paasFormDataESList 数据
     * @throws XbbException 异常
     */
    void formatWaitPurchaseExportValue(List<PaasFormDataEntityExt> paasFormDataESList, FormDataListDTO formDataListDTO) throws XbbException;

    void updateContractDate(List<Map<String, Object>> updateContractEntity, String corpid)throws XbbException;
    /**
     * 待出库合同维度导出
     *
     * @param paasFormDataESList 数据
     * @throws XbbException 异常
     */
    void formatWaitOutstockContractExportValue(List<PaasFormDataEntityExt> paasFormDataESList, FormDataListDTO formDataListDTO);
    /**
     * app端待出库权限设置
     *
     * @param productPaasFormDatas 数据
     * @throws XbbException 异常
     */
    List<FieldAttrEntity>  processContractAndproductExplain(List<PaasFormDataEntityExt> productPaasFormDatas, Map<Long, PaasFormDataEntity> contractMap, List<ContractProductEntity> contractProductEntityList, UserVO loginUser, String corpid, Long formId, String userId, StringBuffer coUserListStr, StringBuffer mainUserListStr) throws XbbException;
    /**
     * @Author mingliang
     * @Description 一致性更新关联机会
     * @Date 2022/5/30 14:18
     * @param corpid
     * @param dataId
     * @param serialNo
     * @param attr
     **/
    void dataConsistencyUpdateOpportunity(String corpid, Long dataId, String serialNo, String attr);
}